# DreamLife/views.py

from django.shortcuts import render, redirect


def index(request):
    if request.user.is_authenticated:
        login = True
    else:
        login = False
    return render(request, 'index.html', {'login': login})


def developersView(request):
    return render(request, 'developers.html')  # 渲染 developers.html 页面


def feedbackView(request):
    return render(request, 'feedback.html')


def documentView(request):
    return render(request, 'document.html')


def submit_feedback(request):
    if request.method == 'POST':
        # 处理从表单提交的数据
        title = request.POST.get('title')
        name = request.POST.get('name')
        contact = request.POST.get('contact')
        content = request.POST.get('content')

        # 可以在这里添加处理逻辑，如将反馈保存到数据库

    return redirect('index')  # 将用户重定向到首页

